home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
CMOSRAM.ARJ
/
CMOS_RAM.DOC
< prev
next >
Wrap
Text File
|
1991-07-24
|
16KB
|
246 lines
CMOS_RAM.EXE:
I. INTRODUCTION
Inside (almost) each and every one of the 47.2 billion IBM AT
clones sold daily there lives an elegant solution to the problem of
configuring a flexible yet easy to use computer system: the internal
CMOS configuration RAM.
When IBM designed the AT they listened to their customer's
grumblings enough to know that one of the major stumbling blocks for
the average PC and XT user was figuring out how to set the motherboard
DIP switches. Business users also complained about not having a built
in real time clock. (I guess the sales racked up by companies like AST
on their multifunction boards with clocks didn't hurt any either!) So
now all AT's also have battery backed up clocks. IBM solved both
problems with one IC - a clock calendar chip made by Motorola
(MC146818) which includes 50 bytes of user addressable non volatile
RAM. This same chip is also used by many clone makers, but other
configurations which perform identically are possible.
So now, instead of flipping DIP switches to configure your
computer, the AT uses software to store the machine's configuration.
This software takes the form of a setup program provided by the BIOS
manufacturer, either resident in the BIOS ROM or in a disk based
utility called (you guessed it) SETUP. True Blue IBM users will find
it on their Advanced Diagnostics Diskette. The idea is that with this
program, you can quickly install or remove equipment from the computer
without having to search for the documentation. In reality, the
success of this approach depends on the quality of the software. Most
of the programs I've seen are pretty bare bones, but passable.
And what kind of information is stored in this ROM? Quoting from
IBM's Personal Computer AT Technical Reference Manual - an excellent
way for those who feel their bank account is $125 too heavy to correct
the situation - the following information is stored in the CMOS ROM:
1. Clock information
2. Diagnostics status byte
3. Shutdown status byte
3. Diskette drive type byte - drives A and B
4. Fixed disk drive byte - drives C and D
5. Equipment byte (# of diskette drives, display adapter and math
coprocessor)
6. Low and high base memory bytes
7. Low and high expansion memory bytes
8. A checksum byte to confirm the validity of the stored data
In addition, there are several bytes of memory whose use IBM does
not specify, but instead marks them as reserved. Perhaps they are
there to allow DOS to smash the 640K barrier with an additional 3 bytes
of slow memory.
II. THE SNAG
Well, this all sounds very nice and possibly even remotely
interesting but probably fits in the same category as general
relativity theory: Interesting But Of Little Use In Everyday Life (move
over, Albert). Ah, but here's the rub: much like the IRS, it can cause
you grief without warning.
Think about it: what's been the problem with every battery
operated toy you've ever had? That's right, (unless you broke it
first) eventually the batteries died! And there's little more useless
than a toy with dead batteries - including your AT.
How long can you expect the battery life to be? It's difficult to
say; many different battery types are in use. However, two kinds
dominate the marketplace: the lithium cell and the alkaline battery
pack. (A few manufacturers use a rechargeable NICAD pack and claim
infinite life. If you buy one of these, write to the manufacturer and
demand complete test results.) The batteries are being used at a very
low current drain, so their lifetime is essentially equal to what the
manufacturer calls the shelf life. This number varies widely, but 2 to
3 years is probably a typical number. Your mileage may vary.
What would the symptoms of a dead battery be? Again, it varies
among BIOS manufacturers, but most of them do a check of the CMOS RAM
at power up. If the check bounces, the boot process will generally
halt with an error message. BIOS's with disk based setup programs will
then assume some kind of default state, usually a lowest common
denominator type of setup with 512K of RAM and 1 floppy drive; those
with internal setup programs often just halt. Now you have to
recognize that this machine - which worked fine yesterday but is now
mysteriously broken - only needs a new battery to be back on it's feet.
Otherwise, you're in for an expensive service call and some downtime.
Oh yes, it does need one other thing - it needs to be
reconfigured! I hope you remember how many cylinders and heads your
hard disk has... Well, it should be in the documentation - if only you
could find it. And the diskette with the SETUP program?! Or maybe you
don't really know that much about computers so the dealer you bought it
from configured it for you and maybe THAT GUY WENT OUT OF BUSINESS 2
YEARS AGO 'cause you bootlegged LOTus and WordPerfect from your brother
in law and maybe YOU DON'T EVEN KNOW WHAT KIND OF DISK DRIVES ARE IN
THE MACHINE and maybe YOU DON'T KNOW HOW TO SETUP YOUR MACHINE because
you've NEVER DONE IT BEFORE... Well, no time like the present to
learn! Will there be snags the first time you try it? Of course there
will be! Will there be a crucial job whose deadline comes and goes
while you pore over reams of documentation as the rest of the free
world sleeps soundly? Of course there will be!
A gloomy picture isn't it? But don't worry, be happy, now there's
III. HOPE FOR THE DAMNED: CMOS_RAM.EXE
CMOS_RAM.EXE is a program whose sole purpose in life is to
minimize the pain of silicon senility, premature or otherwise. How
does it do that? Simple! By storing the contents of your CMOS RAM in
a file while the computer is up and running, it can be quickly and
easily restored when the unthinkable - but inevitable - occurs. Here's
how you do it:
Make up what I call a "disaster" floppy. This is a bootable
floppy disk (consult your DOS manual or the little kid next door if you
don't know how to do that) with AUTOEXEC.BAT and CONFIG.SYS files
almost exactly the same as those which reside on your hard disk.
However, since you could be using this disk when things are flaky,
leave out most of the memory resident stuff - they might confuse the
issue. In addition, I'd include a copy of your hard disk restore
program, a simple ASCII text editor, and something like PC TOOLS to
allow you to play around trying to fix whatever the problem might be.
Try booting from this floppy to ensure that you haven't forgotten
anything.
Oh, and one more thing should be included (flourish of trumpets):
CMOS_RAM.EXE! With the disaster floppy in the diskette drive, simply
type cmos_ram, press return, and after a short but delightful
introductory screen the program will present you with 5 choices:
1: About the CMOS RAM
2: Save the contents of your CMOS RAM to a disk file
3: Restore the CMOS RAM from the disk file
4: Set the CMOS clock
5: Exit
Pressing 1 brings up a series of help screens, which basically
repeat the text in this document in a shorter and less witty fashion.
Perhaps you will prefer this.
Option 2 is the one you'll use first to save the CMOS RAM's
contents. As long as there is around 250 bytes of available space on
the disk, a file called CMOS.RAM will be written and checked for validity.
The third option is the one employed to bring your system back
from the dead. As long as the program can find the CMOS.RAM data file
in the current subdirectory, RAM restoration will take place very
quickly (less than one second). Everything should be copasetic now,
except that the time will be set to whatever time it was when you saved
the RAM. No problem, that's what option 4 is for.
Option 4 allows the setting of the clock to the current date and
time. This option does not affect the current DOS time, so the change
will not take effect until you reboot. You can use this option
whenever you have to change the date or time, such as going on and off
daylight savings time. Curiously, although the MC146818 has a daylight
savings time function, DOS does not use it. It also has a day of the
week function, but DOS works that out on it's own. Go figure.
One caveat: the routines I wrote for setting the time and date
will work for any BIOS that follows the IBM guidelines. I have tested
the program on machines with Phoenix, Award, and AMI BIOS's, and it
works on all of them. However, it would be possible to design a
hardware/software system for which this program would not work
correctly. However, it should not damage the system in any way.
Do I have to explain the fifth option?
IV. DEALING WITH DISASTER
So it's finally happened - your AT won't boot up. Does it give
you a message relating to an invalid configuration, or anything else
that makes you think it could be the CMOS RAM? A typical example would be:
Invalid configuration information - please run SETUP program Strike the
F1 key to continue
Your next move depends on your machine. Units with ROM based
setup programs usually won't proceed any further no matter what you do.
You must press a key, or combination of keys, to enter the setup
routine and configure the system to at least recognize the A: floppy
drive. Don't bother with the rest of the information; running CMOS_RAM
as explained in the next paragraph will take care of that as long as
the machine will boot.
Computers with disk based SETUP programs have it easier. These
machines usually allow the A: floppy to work no matter what the
contents of the CMOS RAM are, so just whip out your disaster floppy and
run CMOS_RAM. Select option 3, and then set the time and date with
option 4. If no error messages result, open the drive A: door and
reboot the machine with CTRL-ALT-DEL. You should be up and running
that fast!
But now you're faced with replacing the battery. This means you
or a technically oriented friend upon whom you can impose are going to
have to open up the machine and get a replacement for the battery. The
more conservative among us might be well advised to make a hard disk
backup before opening the machine. If you just know how to use a
screwdriver, and how to replace the batteries in a flashlight, you
should be able to do the work yourself. Computer hardware knowledge is
usually not required. A hint: most batteries are either stuck to the
back wall of the computer in a holder or on the motherboard in a "coin
cell" holder.
However, in some cases it still may be worthwhile to take your
computer to an authorized repair station. An example of such a case
would be if opening the computer required a tool you've never seen
before, or if you really are just all thumbs with hardware.
A WORD OF WARNING:
Do I really have to remind you to unplug the computer before
opening the case? Please do. Also, never touch anything on a printed
circuit board without touching a large metal object first. This is not
a good time to wear your knit sweaters... anything with "static cling"
is a bad idea!
If your machine uses 4 alkaline AA cells, you can just run to the
corner convenience store and pick up replacements. Be sure to get a
reliable alkaline brand, such as Eveready, Duracell, Radio Shack, or
Kodak. Look for a good expiration date. If the batteries simply slip
into the holder, put a sturdy rubber band around the holder to hold
them securely in case of rough handling.
Those with lithium batteries are in for a little rougher time
locating a replacement. Luckily, our friends at Radio Shack have a
rather nice selection of replacement batteries, including some which
look as though they should do the job for most models. If not, the
Radio Shack catalog says they will special order any battery, although
I don't know how good they are. As a last resort, you may have to
contact your manufacturer.
ANOTHER WORD OF WARNING:
NEVER EVER EVER carry a lithium battery loose in your pocket or in
a purse. When shorted - such as with coins or keys - lithium batteries
are an explosion and burn hazard. These cells pack a hefty wallop, and
while current types have an over-pressure venting system DON'T TRY IT!
Put the cell in an envelope, wrap tape around it, or figure out some
other way to insulate it. Leave the new cell in it's protective
packaging until you're ready to use it. Also, be sure to dispose of
the old cell per the manufacturer's instructions.
Another thought to share with you: you can't ease the replacement
process the next time by buying two sets of batteries and keeping one
aside. Since the battery's lifetime is essentially equal to it's shelf
life, when the one in use quits the other will be at the end of it's
life also. Buy a fresh one.
Once the battery is in place, go through the ritual outlined above
one last time, and then you're back in business.
V. WAIT, THERE'S MORE
Well, it seems that CMOS_RAM has made the world safe for truth,
justice, and the American way. By taking a few minutes to prepare
before disaster strikes, I say BEFORE DISASTER STRIKES, a potentially
expensive service call can be handled by anyone with a basic knowledge
of tools and the inside of a computer.
However, one problem with a program like CMOS_RAM is that it's
easy to use it and forget about it. After all, it could be several
years until you need it. In that time, you could easily change your
hardware and forget to update CMOS.RAM, defeating the program's purpose
and increasing your hassles.
Enter CHEKCMOS. Just install this program in your AUTOEXEC.BAT
file along with a copy of CMOS.RAM in the same directory. This program
helps you two ways. First, it checks two self test status functions of
the MC146818 IC to ensure that it's data is valid and that the battery
voltage is within the allowable limits. If either of these checks
fails, a warning is generated. In theory, this should serve notice
that the battery is on it's last legs in time to replace it. However,
in the real world, batteries often fail suddenly, so don't count on
knowing in advance.
The other function of CHEKCMOS is to make sure that the contents
of the file CMOS.RAM match what's in the CMOS RAM itself, with the
exception of the time and date. This will remind you to update
CMOS.RAM when you make a hardware change. Also, it will absolutely
find any CMOS RAM failures which go undetected by the IC's self test
features.